package com.miyake.loveviewweb.client.dialog;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.TextBox;

public class TextDialog extends Composite implements HasText, IDialogPanel {

    private static TextDialogUiBinder uiBinder = GWT
        .create(TextDialogUiBinder.class);
    @UiField TextBox textField;

    interface TextDialogUiBinder extends UiBinder<Widget, TextDialog> {
    }

    public TextDialog() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    public TextDialog(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
        textField.setText(firstName);
    }

    public void setText(String text) {
        textField.setText(text);
    }

    public String getText() {
        return textField.getText();
    }

    public void setDialogHandler(DialogHandler handler) {

    }

    public Composite getComposite() {
        return this;
    }

}
